/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package speechprocess;

/**
 *
 * @author Oanh
 */
public class Complex {

    double real;
    double image;

    //Định nghĩa số phức
    public Complex(double real, double image) {
        this.real = real;
        this.image = image;
    }

    //Nhân 2 số phức
    public Complex mul(Complex otherComplex) {
        return new Complex(real * otherComplex.real - image * otherComplex.image,
                real * otherComplex.image + image * otherComplex.real);
    }

    //Module số phức
    public double module() {
        return Math.sqrt(real * real + image * image);
    }
}
